Remove Public Folder with heading \ as name
A Public Folder was accedently created as \bad folder\name and now can't do anything with it.

Get-PublicFolder -GetChildren|?{$_.Name -Like '\*'}

PowerShell line above works to find it, but trying to delete with Remove-PublicFolder or rename with Set-PublicFolder to get rid of the bad folder result in error about incorrect format of PublicFolderIdParameter. I've tried to use Exchange Online tenant as OrganizationName without effect.
If trying to use Outlook as client to do anything with it gives the behavior as not being owner of folder (grayed out delete/rename option, missing tabs in properties).

Get-PublicFolder -GetChildren | Remove-PublicFolder
Get-PublicFolder -GetChildren|?{$_.name -like '\*'} | % {Set-PublicFolder $_.identity -Name 'crap'}

Cannot process argument transformation on parameter 'Identity'. Cannot convert value "?\bad folder\name" to type "Microsoft.Exchange.Configuration.Tasks.PublicFolderIdParameter". Error: "The value provided for parameter "?\bad folder\name" isn't in the correct format. The correct format is "<OrganizationName>\\<FolderPath>"."
                                + CategoryInfo          : InvalidData: (:) [Set-PublicFolder], ParameterBindin...mationException
                                + FullyQualifiedErrorId : ParameterArgumentTransformationError,Set-PublicFolder
                                + PSComputerName        : outlook.office365.com

July 1st, 2015 1:50pm

Hi Henrik,

Thank you for your question.

We could refer to the following steps:

  1.        Restart the service of Microsoft Exchange information storeserver
  2.        Then run the Get-PublicFolder to check if we could get it.
  3.        We could run the following command to check if public folder was deleted:

Remove-PublicFolder -Identity " <OrganizationName>\bad folder\name" -Recurse

If there are any questions regarding this issue, please be free to let me know.

Best Regard,

Jim

Free Windows Admin Tool Kit Click here and download it now
July 2nd, 2015 3:47am

The only way I can see the folder when using PowerShell is by filtering the output from Get-PublicFolder \ (either -GetChildren or -Recurse, but it's quicker with -GetChildren not needing to traverse through whole structure) and access the attributes in the resulting object. I can't use the object as input to Get-PublicFolder, Set-PublicFolder or Remove-PublicFolder.
As Damian managed to rename a folder to contain \ and later reverse the change, it's not the name itself that is the issue.
If I try to do anything with my corrupt folder, I get error about Identity is in incorrect format. If looking on Identity property, it has a leading ? (probably some non-printable character) like ?\bad folder\name

It's not on-prem Exchange, it's Exchange Online (Office 365) and I have no access to restart services.
I guess the thread was created in wrong forum. Jim, can you as moderator maybe move thread to better forum for Exchange Online / Office365?

As suggested in the thread I posted at Experts-Exchange.com, I contacted Office 365 support this morning by creating a support ticket in the Office365 admin portal. When troubleshooting with the support technician, I managed to get rid of the corrupt folder..

Solution:
In the Office365 portal, go to admin -> Exchange -> public folders.
Clicking on the corrupt folder in the Office365 admin portal gave the same error message about Identity is incorrect as when using PowerShell. Trying to go up to parent folder by using up arrow button gave some other error message. After repeating the up arrow clicking a couple of times and confirming the error messages, I got back to root folder where the folder was marked. 
By using the recyclebin button to delete the marked folder, it was finally removed.

July 2nd, 2015 7:43am

Henrik,

Glad you were able to find a solution to your issue, however, next time please post your question in the appropriate forum.  This forum is for Exchange 2013, not Office 365. Please go to https://community.office365.com/en-us/f/ to post future questions on Office 365.  There are some subtle differences on how code will work and what features are revealed to Office 365 Admins.  At the very least, identity your environment as Office 365 when posting in the Exchange 2013 forums.

Thanks!

Free Windows Admin Tool Kit Click here and download it now
July 2nd, 2015 8:21am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics